$(function () {
    var html = getCookie("orderingListhtml");
    $('.order-wrap').html(html);
    function getCookie(cname) {
        var ss = document.cookie;
        var name = cname + "=";
        var ca = document.cookie.split(';');
        for(var i=0; i<ca.length; i++)
        {
            var c = ca[i].trim();
            if (c.indexOf(name)==0)
                return c.substring(name.length,c.length);
        }
        return "";
    }
    $('.delete').click(function () {
        var parent = $(this).parent().parent();
        var filmName = ($(this).parent().parent().children("div").eq(0).html());
        // alert(filmName);
        var hallFilmTime = ($(this).parent().parent().children('div').eq(1).html());
        // alert(hallFilmTime);
        var hallSerialNumber = ($(this).parent().parent().children('div').eq(2).html());
        var seatSerialNumber = ($(this).parent().parent().children('div').eq(3).html());
        $(this).parent().parent().remove();
        // var formData = new FormData();
        // formData.append("filmName",filmName);
        // formData.append("hallFilmTime",hallFilmTime);
        // formData.append("hallSerialNumber",hallSerialNumber);
        // formData.append("seatSerialNumber",seatSerialNumber);
        $.getJSON('/order/delete',function (data) {
            if (data.success){
                $.toast('取消成功！');
            }
        })
    });
});